home *** CD-ROM | disk | FTP | other *** search
- Using TinyGL in VP asm code
- ======================================
-
-
- TinyGL can be used in VP programs by calling it's shared libraries. Two qcallable
- tools are provided to this purpose:
-
- ami/lib/ad709/tinygl/init
- provides a link into the library's functions for future use
-
- inputs
- - i: specifies which library to link to (options: GL_LIB, GLUT_LIB, GLU_LIB)
- outputs
- - p: pointer to the library's function address table (NULL if error)
- - p: pointer to the library's handle (NULL if error)
-
-
-
- ami/lib/ad709/tinygl/deinit
- frees up resources used by the library binding
-
- inputs
- - p: pointer to the library's function address table
- - p: pointer to the library's handle
-
-
- Once the function table pointers have been obtained, these should be copied into
- a global variable. Some macros are already defined in 'gl.inc' to facilitate this.
- The GL, GLUT and GLU macros, can hold the address of the function tables.
-
- For example
-
- cpy.p p0, GL
- cpy.p p1, GLUT
-
- where p0 and p1 are pointers to the gl and glut function tables obtained by the
- 'ami/lib/ad709/tinygl/init' tool.
-
- GL and GLUT can now be used as pointers to the libraries' function tables.
- To call specific API functions, the function's address must be obtained, using
- the API macros:
-
- glFoo(GL)
- returns a pointer to the "glFoo" function (sub-routine) in the GL API
-
- glutBar(GLUT)
- returns a pointer to the "glutBar" function (sub-routine) in the GLUT API
-
- Finally, the functions are called using "gos". Example:
-
- gos glClear(GL), (GL_COLOR_BUFFER_BIT : -)
-